home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / GRAHAM / XA_6S.ZIP / SOURCE / CLOSWIDG.C < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-17  |  1.4 KB  |  61 lines

  1. /*
  2.  * XaAES - XaAES Ain't the AES
  3.  *
  4.  * A multitasking AES replacement for MiNT
  5.  *
  6.  */
  7.  
  8. #include <OSBIND.H>
  9. #include <VDI.H>
  10. #include "XA_TYPES.H"
  11. #include "XA_DEFS.H"
  12. #include "XA_GLOBL.H"
  13. #include "KERNAL.H"
  14. #include "K_DEFS.H"
  15. #include "GRAF_MOU.H"
  16. #include "MESSAGES.H"
  17. #include "C_WINDOW.H"
  18. #include "RECTLIST.H"
  19. #include "ALL_WIDG.H"
  20. #include "STD_WIDG.H"
  21. #include "SYSTEM.H"
  22. #include "OBJECTS.H"
  23.  
  24. /*======================================================
  25.     CLOSE WIDGET BEHAVIOUR
  26. ========================================================*/
  27. /* Display the closer widget */
  28. short display_close_widget(XA_WINDOW *wind, XA_WIDGET *widg)
  29. {
  30.     short x,y;
  31.  
  32.     rp_2_ap(wind, widg, &x, &y);
  33.  
  34.     if (widg->stat==XAW_PLAIN)
  35.         def_widgets[WIDG_CLOSER].ob_state&=~SELECTED;
  36.     else
  37.         def_widgets[WIDG_CLOSER].ob_state|=SELECTED;
  38.     
  39.     display_object(def_widgets,WIDG_CLOSER,x,y);
  40.  
  41.     return TRUE;
  42. }
  43.  
  44. /* 
  45.  Default close widget behaviour - just send a WM_CLOSED message to the client that
  46.  owns the window.
  47. */
  48. short click_close(XA_WINDOW *wind, XA_WIDGET *widg)
  49. {
  50.     if (wind->active_widgets&NO_MESSAGES)    /* Just close these windows, they can handle it.... */
  51.     {
  52.         close_window(wind);
  53.         delete_window(wind);
  54.         return FALSE;    /* Don't redisplay in the do_widgets() routine as window no longer exists */
  55.     }
  56.     
  57.     send_app_message(wind->owner, WM_CLOSED, 0, wind->handle, 0, 0, 0, 0);
  58.  
  59.     return TRUE; /* Redisplay.... */
  60. }
  61.